Xbasic

DIR_REMOVE_RECURSE Function

Syntax

Success_Flag as L = dir_remove_recurse(C dir_name [,L suppress_dialogs ])

Arguments

Success_Flag

Indicates whether the function was able to delete anything.

dir_name

The initial directory to delete. This argument cannot be equal to "".All sub-directories and files below this level are deleted. The directory does not need to exist.

suppress_dialogs

Logical. Optional. Default = .F. .T. = Suppresses all dialogs. .F. = Displays a dialog lists the directory that is about to be deleted and states that deleted flies cannot be recovered. Displays a warning dialog is displayed if the selected directory does not exist.

Description

Removes a directory and all of its contents

The DIR_REMOVE_RECURSE() function recursively deletes a directory and everything in it. This is similar to deltree in DOS or rmdir /q /s at the NT/XP command line.

This function is dangerous. Using it at the C:\ prompt could potentially delete everything on your disk and ruin your day.
Success_Flag = DIR_REMOVE_RECURSE( "c:\temp\\" )

See Also